package com.pi2e.view.common;

import com.pi2e.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

/**
 * @ClassName: HeaderView
 * @Description: TODO(头部View)
 * @author luotao
 * @date 2016年9月26日 下午3:37:13
 *
 */
public class HeaderView {

	public ImageView titleLeft_Iv;

	public TextView title_Tv;

	public Context context;

	public View view;

	public HeaderView(View view, Context context) {
		this.view = view ;
		this.titleLeft_Iv = (ImageView) view.findViewById(R.id.iv_titleLeft) ;
		this.title_Tv = (TextView) view.findViewById(R.id.tv_title) ;
	}

	public HeaderView() {
	}

	public ImageView getTitleLeft_Iv() {
		return titleLeft_Iv;
	}

	public void setTitleLeft_Iv(ImageView titleLeft_Iv) {
		this.titleLeft_Iv = titleLeft_Iv;
	}

	public HeaderView getHeaderView(){
		
		return this ;
	}
	public HeaderView setText(String title){
		getTitle_Tv().setText(title) ;
		return this ;
	}
	@SuppressLint("NewApi")
	public HeaderView setImageView(Drawable drawable){
		getTitleLeft_Iv().setBackground(drawable);
		return this ;
	}
	
	public HeaderView setImageView(int ivId ){
		getTitleLeft_Iv().setBackgroundResource(ivId);
		return this ;
	}

	public Context getContext() {
		return context;
	}

	public void setContext(Context context) {
		this.context = context;
	}

	public View getView() {
		return view;
	}

	public void setView(View view) {
		this.view = view;
	}

	public TextView getTitle_Tv() {
		return title_Tv;
	}

	public void setTitle_Tv(TextView title_Tv) {
		this.title_Tv = title_Tv;
	}

}
